package com.cn.wanxi.servlet;

import com.cn.wanxi.model.CompanyModel;
import com.cn.wanxi.model.NavModel;
import com.cn.wanxi.service.ICompanyService;
import com.cn.wanxi.service.INavService;
import com.cn.wanxi.service.impl.CompanyServiceImpl;
import com.cn.wanxi.service.impl.NavServiceImpl;

import javax.servlet.http.HttpServletRequest;

public class CommonServlet {
    public static void setCompanyAndNavData(HttpServletRequest req){
        ICompanyService iCompanyService = new CompanyServiceImpl();
        CompanyModel companyModel = iCompanyService.setCompanyModel();
        req.setAttribute("companyModel", companyModel);


        INavService navService = new NavServiceImpl();
        NavModel[] navModels = navService.getNavModels();
        req.setAttribute("navModels", navModels);
    }
}
